package git.LiuZhanHong.Demo3_18;
//矩形类
public class Rectangle extends Shap{
    private int width;//设置矩形的宽度
    private int height;//设置矩形的高度

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }
    public Rectangle(String name,int width,int height)
    {
        super.drawing();
        this.width=width;
        this.height=height;
    }

    //面积方法
    public void area()
    {
        System.out.println("矩形的面积是："+width*height);
    }
}
